--- title: Timeseries keywords: fastai sidebar: home_sidebar summary: "Recipes for timeseries" description: "Recipes for timeseries" nb_path: "nbs/03_modeling/timeseries.ipynb" ---
df = pd.read_csv('https://raw.githubusercontent.com/ritvikmath/Time-Series-Analysis/master/ice_cream_vs_heater.csv', index_col=0, parse_dates=[0])
df.head(3)
fig = px.line(df, x=df.index, y='heater')
df2 = df.copy()
for col in df2:
df2[f'boxcox_{col}'] = boxcox(df2[col])[0]
df2[f'zscore_{col}'] = zscore(df2[col])
fig = px.line(df2, y=['heater', 'boxcox_heater', 'zscore_heater'])
df3 = df2.diff().dropna()
px.line(df3, y=['boxcox_heater'])
df4 = df3 / df3.groupby(df3.index.year).transform('std')
px.line(df4, y='heater')
df5 = df4 / df4.groupby(df4.index.month).transform('mean')
px.line(df5, x=df5.index, y='heater')